package com.htdc.web.service;

import com.htdc.web.bean.Company;
import com.htdc.web.bean.ProjectTb;
import com.htdc.web.dao.ProjectDao;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author:zbc
 * date:2018/9/5
 * description:
 */
@Service
public class ProjectService {

    @Autowired
    private ProjectDao projectDao;

    // 添加项目名称、所属公司、项目地址
    public void addProject(String pname , int cid , String address){
        projectDao.addProject(pname, cid, address);
    }
    
    //查看项目
    public ProjectTb getProject(int pid){
        return projectDao.getProject(pid);
    }

    //编辑项目
    public void updateProject(int pid, int cid,String pname,String address){
        projectDao.updateProject(pid, cid , pname, address);

    }

    public List<ProjectTb> getProjectByCid(int cid){
        return projectDao.getProjectByCid(cid);
    }

    //获取所有公司集合
    public List<Company> getAllCompanies(){
        return projectDao.getCompanies();
    }

}
